import logging
from typing import List

from mcp.server.fastmcp import FastMCP

import __init__
from api.plugins.plugin_types import RetrievalResult

mcp = FastMCP("main")


@mcp.tool('main_qa_retrieval')
async def retrieval(query: str, slang: List[dict]) -> List[RetrievalResult]:
    return [RetrievalResult(id='qa1')]


# 该启动函数是必须的，不能删除
if __name__ == "__main__":
    # 日志打印是确保__init__引用
    logging.debug('', __init__)
    mcp.run(transport='stdio')
